import { View } from "@tarojs/components"
import { Component, Fragment } from "react";
import "./index.scss";

interface ActivityState {
    
}
interface ActivityStateProps{
    obj:any,
    title:string,
    activity:any,
    price:any
}


class Activity extends Component<ActivityStateProps, ActivityState> {
    constructor(props) {
        super(props)
        this.state={

        }
    }
    render() {
        const { obj ,title,price,activity} =this.props;
        // console.log('activity',activity)
        return (
            <Fragment>
                <View className="activity">
                    <View style="width:100%;height:20rpx"></View>
                    <View className="activityTop">
                        <View className="tag dis">{activity.type==='1'?title:'拼团'}</View>
                        {
                          activity.type==1?  (activity.limit_buy_num>0? <View className="tag dis tags">{`限购${activity.limit_buy_num}件`}</View>:null):(activity.min_user_num>0?<View className="tag dis tags">{`${activity.min_user_num}人拼团`}</View>:null)
                        }
                        {/* <View className="tag dis tags">{activity.limit_buy_num>0?`限购${activity.limit_buy_num}件`:`不限购买`}</View> */}
                    </View>
                    <View className="activityBotm">
                        <View className="btomLeft">
                            <View className="prics">¥{activity.price}</View>
                            <View className="pricsLis">¥{price}</View>
                        </View>
                        <View className="rigth">
                            <View className="rigop dis">即将结束</View>
                            <View className="rigBot">
                                <View className="day dis">{obj.d}</View>
                                <View className="dian">:</View>
                                <View className="day dis">{obj.h}</View>
                                <View className="dian">:</View>
                                <View className="day dis">{obj.m}</View>
                                <View className="dian">:</View>
                                <View className="day dis">{obj.s}</View>
                            </View>
                        </View>
                    </View>
                </View>
            </Fragment>
        )
    }
}

export default Activity